/**
 * Copyright 2007-2008 Vidar Svansson
 *     
 * This file is part of JAdapter.
 * 
 * JAdapter is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 * 
 * JAdapter is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 * 
 * You should have received a copy of the GNU General Public License
 * along with JAdapter.  If not, see <http://www.gnu.org/licenses/>.
 */
package org.jadapter.registry;

/** 
 * The smallest interface for a client program to get access to the transformers.
 * This is a <em>read-only</em> access, clients can only ask for transformations, 
 * but can not register new transformers (or remove existing).
 * <br></br><br></br>
 * Application that needs to configure and setup a registry should use the {@link AdapterRegistry}.
 * On the other hand, application should only depend on on this interface after configuration.
 * <br></br><br></br>
 * Client code that does not want to depend on this interface can use a {@link org.jadapter.weavers.Weaver}
 * for AOP style usage.
 * 
 * @author Vidar Svansson
 * @since 0.2
 *
 */
public interface TransformerRegistry {

    /** 
     * Get an instance of the given some context object. 
     * This is the main method.
     * @param context The object to transform.
     * @param type The desired type to transform to.
     * 
     * @return an instance of T if it is possible to transform
     * the context to the type.
     * 
     * @since 0.1
     */
    public <T> T transform(Object context, Class<T> type) ;
	
}
